<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="30 seconds">

    <!-- To enable JMX Management -->
    <jmxConfigurator/>

    <appender name="file" class="ch.qos.logback.core.FileAppender">
        <file>${TOPJAVA_ROOT}/log/topjava.log</file>

        <encoder>
            <charset>UTF-8</charset>
            <pattern>%date %-5level %logger{50}.%M:%L - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <charset>UTF-8</charset>
            <pattern>%d{HH:mm:ss.SSS} %highlight(%-5level) %cyan(%class{50}.%M:%L) - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="ru.tbcarus.topjava" level="debug"/>
    <logger name="org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver" level="debug"/>
    <logger name="org.springframework.security" level="debug"/>
    <logger name="org.springframework.security.web.csrf.CsrfFilter" level="debug"/>

    <root level="info">
        <appender-ref ref="file"/>
        <appender-ref ref="console"/>
    </root>
</configuration>
